" Vim color file
"
" Name:        jmdkina.vim
" Version:     1.0
" Maintainer:  jmdvirus <bingfengchengzhu@gmai.com>
"
"
" Initialization {{{
if &t_Co != 256 && ! has("gui_running")
  echomsg ""
  echomsg "err: please use GUI or a 256-color terminal (so that t_Co=256 could be set)"
  echomsg ""
  finish
endif

hi clear

if exists("syntax_on")
  syntax reset
endif

let colors_name = "jmdkina"
let gui = 'no'

" define some colors
if &background=='light'
  let line=13
  let lineback=248
  let status=191
  let statusback=129
  let todoback=248
  let type=21
  let char=234
  let special=129
  let speccom=236
  let string=57
  let statement=23
  let comment=59
elseif &background=='dark'
  let line=29
  let lineback=233
  let status=191
  let statusback=238
  let todoback=233
  let type=61
  let char=5
  let special=203
  let speccom=200
  let string=38
  let statement=197
  let comment=59
  let RoyalBlue      = '4169E1'
  let MediumBlue     = '0000CD'
  let GhostWhite     = 'F8F8FF'
  let Black          = '000000'
  let FireBrick      = 'B22222'
  let Red            = 'FF0000'
  let Crimson        = 'DC143C'
  let Peru           = 'CD853F'
  let DarkGrey       = 'A9A9A9'
  let Silver         = 'C0C0C0'
  let Gainsboro      = 'DCDCDC'
  let Sonoma         = 'DFDBC3'
  let CoffeeBean     = '4D2F2D'
  let Lavender       = 'FDD7FF'
  let DarkOrchid     = 'B91BC7'
  let Bubblegum      = 'FDD7D6'
  let Suede          = '943A20'
  let Aqua           = 'B4FFFF'
  let VeryGreen      = '4BA50E'
  let Turquoise      = '3AE6E7'
  let DarkCyan       = '2BA3B8'
  let MellowYellow   = 'E7E700'
  let KissTheSky     = '69D7FF'
endif

" Sets the highlighting for the given group
fun    SX(group, fg, bg, attr)
  if a:group != ""
    if a:attr != ""
      exec "hi " . a:group . " cterm=" . a:attr
    endif
    if a:fg != ""
      exec "hi " . a:group . " ctermfg=" . a:fg
    endif
    if a:bg != ""
      exec "hi " . a:group . " ctermbg=" . a:bg
    endif
  endif
endfun
" set color for gui
fun    JKSG(group, fg, bg, attr)
  if a:group != ""
    if a:attr != ""
      exec "hi " . a:group . " gui=" . a:attr
    endif
    if a:fg != ""
      exec "hi " . a:group . " guifg=#" . a:fg
    endif
    if a:bg != ""
      exec "hi " . a:group . " guibg=#" . a:bg
    endif
  endif
endfun


if gui == 'yes'

call      JKSG("Normal", "black", "white", "none")
call      JKSG("Cursor", "", "ffaf00", "")
call      JKSG("CursorColumn", "", "2c2c2c", "")
call      JKSG("CursorLine", "", "2c2c2c", "none")
call      JKSG("Error", "fff", "800000", "none")
call      JKSG("ErrorMsg", "fff", "800000", "none")
call      JKSG("FoldColumn", "9e9e9e", "121212", "none")
call      JKSG("Folded", "eeeeee", "5f5f87", "none")
call      JKSG("IncSearch", "000000", "ffdfaf", "none")
call      JKSG("LineNr", RoyalBlue, "111222", "none")
call      JKSG("type", Aqua, "ffffff", "bold")
call      JKSG("Statement", 'ffff70', "", "none")
call      JKSG("Comment", '4169e1', "", "none")

else

call      SX("Normal", "", "", "")
call      SX("Cursor", "", "214", "")
call      SX("CursorColumn", "", "236", "")
call      SX("CursorLine", "", "236", "none")
call      SX("Error", "244", "84", "none")
call      SX("ErrorMsg", "15", "88", "none")
call      SX("FoldColumn", "247", "233", "none")
call      SX("Folded", "255", "60", "none")
call      SX("IncSearch", "0", "223", "none")
call      SX("LineNr", line, "", "none")
call      SX("type", string, "", "bold")
call      SX("Statement", statement, "", "none")
call      SX("StatusLine", status, statusback, "none")
call      SX("Comment", comment, "", "none")

endif




hi MatchParen   ctermfg=195 guifg=#dfffff ctermbg=238 guibg=#444444 cterm=none gui=none
" TODO
" hi MoreMsg
hi NonText      ctermfg=238 guifg=#303030                           cterm=none gui=none
hi Pmenu        ctermfg=0   guifg=#000000 ctermbg=250 guibg=#bcbcbc
hi PmenuSel     ctermfg=255 guifg=#eeeeee ctermbg=243 guibg=#767676
hi PmenuSbar                              ctermbg=252 guibg=#d0d0d0
hi PmenuThumb   ctermfg=243 guifg=#767676
hi Search       ctermfg=0   guifg=#000000 ctermbg=156 guibg=#afff87 ctermbg=149
hi SignColumn   ctermfg=248 guifg=#a8a8a8
hi SpecialKey   ctermfg=236 guifg=#303030
hi SpellBad     ctermfg=160 guifg=fg      ctermbg=249                cterm=underline               guisp=#df0000
hi SpellCap     ctermfg=189 guifg=#dfdfff ctermbg=249 guibg=bg       cterm=underline gui=underline
hi SpellRare    ctermfg=168 guifg=#df5f87 ctermbg=249 guibg=bg       cterm=underline gui=underline
hi SpellLocal   ctermfg=98  guifg=#875fdf ctermbg=249 guibg=bg       cterm=underline gui=underline


hi StatusLineNC ctermfg=239 guifg=#b2b2b2 ctermbg=237 guibg=#3a3a3a  cterm=none      gui=none
hi TabLine      ctermfg=236 guifg=fg      ctermbg=243 guibg=#666666  cterm=none      gui=none
hi TabLineFill  ctermfg=236 guifg=fg      ctermbg=237 guibg=#3a3a3a  cterm=none      gui=none
" FIXME
hi Title        ctermfg=225 guifg=#ffdfff

call       SX("TODO", 22, todoback, "none")

hi Underlined   ctermfg=39  guifg=#00afff                            cterm=underline gui=underline
hi VertSplit    ctermfg=237 guifg=#3a3a3a ctermbg=237 guibg=#3a3a3a  cterm=none      gui=none
hi Visual       ctermfg=234 guifg=#202020 ctermbg=220 guibg=#ffd000
hi VisualNOS    ctermfg=234 guifg=#202020 ctermbg=200 guibg=#ffd000
hi WildMenu     ctermfg=0   guifg=#000000 ctermbg=150 guibg=#afdf87  cterm=bold      gui=bold

"" Syntax highlighting {{{2

hi Constant     ctermfg=55  guifg=#94bbff                            cterm=none

call       SX("String", type, "", "")

call       SX("Character", char, "", "bold")

hi Boolean      ctermfg=198 guifg=#fefefe                            cterm=bold      gui=none
hi Float        ctermfg=199 guifg=#fefefe 
hi number       ctermfg=28  guifg=#ed7715

hi Identifier   ctermfg=90  guifg=#f786ea                            cterm=none
hi Function     ctermfg=128 guifg=#f786ea 

hi Ignore       ctermfg=238 guifg=#444444
hi preproc      ctermfg=125 guifg=#a1de6f                            cterm=none
hi Define       ctermfg=232 guifg=#a1de6f ctermbg=NONE guibg=#faedca  

call       SX("PreCondit", 199, todoback, "none")

call       SX("Special", special, "", "none")
call       SX("SpecialComment", speccom, "", "bold")

"hi SpecialChar
"hi Delimiter
"hi Debug
"hi Tag

"hi Conditional  ctermfg=128 guifg=#ffff70
"hi Repeat       ctermfg=126 guifg=#ffff71
"hi Label        ctermfg=125 guifg=#ffff71
"hi Operator     ctermfg=124
"hi Keyword      ctermfg=123
"hi Exception    ctermfg=122

"hi StorageClass ctermfg=1  guifg=#e3cdff                            cterm=bold gui=none
"hi Structure    ctermfg=89 guifg=#23de88                            cterm=bold gui=none
"hi typedef


hi StdFunction      guifg=#C777EF     gui=bold  ctermfg=177   cterm=bold
hi UserLabel2	    guifg=#c96129     gui=bold  ctermfg=166   cterm=bold
hi StdName	    guifg=#5276e6     gui=bold  ctermfg=69    cterm=bold
hi MicroController  guifg=#d00000     gui=bold  ctermfg=160   cterm=bold
hi AnsiFuncPtr	    guifg=#ff0000     gui=NONE  ctermfg=196   cterm=none
hi OperatorBold	    guifg=#212832     gui=bold  ctermfg=226   cterm=bold
hi BlockBraces	    guifg=#ae8321     gui=bold  ctermfg=226   cterm=bold

" C math operators
syn match       cMathOperator     display "[-+\*\%=]"" C pointer operators
syn match       cPointerOperator  display "->\|\."
syn match       cLogicalOperator  display "[!<>]=\="
syn match       cLogicalOperator  display "=="
syn match       cBinaryOperator   display "\(&\||\|\^\|<<\|>>\)=\="
syn match       cBinaryOperator   display "\~"
syn match       cBinaryOperatorError display "\~="
syn match       cLogicalOperator  display "&&\|||"
syn match       cLogicalOperatorError display "\(&&\|||\)="
syn match       cFenhao           display ";"
hi cMathOperator            guifg=#3EFFE2                          ctermfg=14
hi cPointerOperator         guifg=#3EFFE2                          ctermfg=14
hi cLogicalOperator         guifg=#3EFFE2                          ctermfg=14
hi cLogicalOperator         guifg=#3EFFE2                          ctermfg=14
hi cBinaryOperator          guifg=#F0088C               gui=NONE   ctermfg=161 
hi cBinaryOperatorError     guifg=white        gui=NONE 
hi cBraces	            guifg=#C777EF   gui=NONE               ctermfg=177  cterm=none
hi cFenhao                  guifg=#FFA70F                          ctermfg=202  cterm=none
hi cMaohao                  guifg=#3EFFE2                          ctermfg=14

syn keyword     jkcfunc           memset
hi  link        jkcfunc           Constant



"" Special {{{2
""" .diff {{{3
hi diffAdded    ctermfg=150 guifg=#afdf87
hi diffRemoved  ctermfg=174 guifg=#df8787
""" vimdiff {{{3
hi diffAdd      ctermfg=236  guifg=bg      ctermbg=151 guibg=#afdfaf
hi diffDelete   ctermfg=236  guifg=bg      ctermbg=246 guibg=#949494 cterm=none gui=none
hi diffChange   ctermfg=236  guifg=bg      ctermbg=181 guibg=#dfafaf
hi diffText     ctermfg=236  guifg=bg      ctermbg=174 guibg=#df8787 cterm=none gui=none
""" HTML {{{3
hi htmlTag      ctermfg=58                                         cterm=bold
hi htmlEndTag   ctermfg=59                                         cterm=bold
hi htmlArg      ctermfg=132  guifg=#dfafdf                         cterm=bold
hi htmlValue    ctermfg=180  guifg=#dfdfaf
hi htmlTitle    ctermfg=242                                        cterm=bold
hi htmlString   ctermfg=203
hi htmlTagN     ctermfg=156
" for javascript
hi javaScriptBrowserObjects       guifg=#DBB6D2 ctermfg=182   gui=italic 

hi javaScriptDOMObjects           guifg=#DBB6D2 gui=BOLD 
hi javaScriptDOMMethods           guifg=#D4FA9B ctermfg=192 
hi link javaScriptDOMProperties   Keyword 

hi javaScriptAjaxObjects          guifg=#5d91d3 gui=underline 
hi javaScriptAjaxMethods          guifg=#6699CC ctermfg=68 
hi javaScriptAjaxProperties       guifg=#FF9494 ctermfg=210 

hi javaScriptFuncName             guifg=#B5E4F7 ctermfg=153 
hi javaScriptHtmlElemProperties   guifg=#FF9494 ctermfg=210 
hi javaScriptEventListenerKeyword guifg=#6699CC ctermfg=68 

""" django {{{3
hi djangoVarBlock ctermfg=180
hi djangoTagBlock ctermfg=150
hi djangoStatement ctermfg=146
hi djangoFilter  ctermfg=174
""" python {{{3
hi pythonExceptions ctermfg=174
""" NERDTree {{{3
hi Directory      ctermfg=110  guifg=#87afdf
hi treeCWD        ctermfg=180  guifg=#dfaf87
hi treeClosable   ctermfg=174  guifg=#df8787
hi treeOpenable   ctermfg=150  guifg=#afdf87
hi treePart       ctermfg=244  guifg=#808080
hi treeDirSlash   ctermfg=244  guifg=#808080
hi treeLink       ctermfg=182  guifg=#dfafdf


delf       SX

" End of jmdkitty.vim
